package com.health.system.service.system.impl;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.health.system.dao.system.UserRoleDao;
import com.health.system.javacommon.base.BaseManager;
import com.health.system.javacommon.base.EntityDao;
import com.health.system.model.system.UserRole;
import com.health.system.service.system.UserRoleManager;

import java.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

@Component("userRoleManager")
@Transactional
public class UserRoleManagerImpl extends BaseManager<UserRole,java.lang.String> 
					implements UserRoleManager {

	private UserRoleDao userRoleDao;
	/**增加setXXXX()方法,spring就可以通过autowire自动设置对象属性*/
	public void setUserRoleDao(UserRoleDao dao) {
		this.userRoleDao = dao;
	}
	public EntityDao getEntityDao() {
		return this.userRoleDao;
	}
	
	@Transactional(readOnly=true)
	public Page findByPageRequest(PageRequest pr) {
		return userRoleDao.findByPageRequest(pr);
	}
	/**bzq add */
	public List getUserRoleList(java.lang.String userId){
		return userRoleDao.getUserRoleList(userId);
	}
	public void deleteUserRoleList(java.lang.String userId){
		 userRoleDao.deleteUserRoleList(userId);
	}
	
	/**
	 * 查询操作员的角色树
	 * @param userId 操作员ID
	 * @return
	 */
	public List getUserRoleTree(String userId){
		return userRoleDao.getUserRoleTree(userId);
	}
	
}
